import { createRouter, createWebHistory } from 'vue-router'
import LoginView from '../views/LoginView.vue';
import UserView from '../views/UserView.vue';
import HomeCenterView from '../views/HomeCenterView.vue';
import ArticleView from '../views/ArticleView.vue';
import NotifyView from '../views/NotifyView.vue';
import LayoutView from '../views/LayoutView.vue';

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/login',
      name: 'Login',
      component: LoginView,
    },
    {
      path: '/',
      name: 'Layout',
      component: LayoutView,
      children: [
        {
          path: 'user',
          name: 'User',
          component: UserView,
        },
        {
          path: 'home',
          name: 'Home',
          component: HomeCenterView,
        },
        {
          path: 'article',
          name: 'Article',
          component: ArticleView,
        },
        {
          path: 'notify',
          name: 'Notify',
          component: NotifyView,
        },
      ],
    },
  ]
})

export default router
